package com.yc.bbs.controller;

import com.yc.bbs.dao.TopicMapper;
import com.yc.bbs.entity.Topic;
import net.sf.jsqlparser.statement.select.Top;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * BBS论坛-帖子表-19 前端控制器
 * </p>
 *
 * @author ly
 * @since 2024-11-23
 */
@RestController
@RequestMapping("/topic")
public class TopicController {

    @Autowired
    private TopicMapper topicMapper;

    @RequestMapping("/latest")
    public List<Topic> queryLatestTopics() {
        return topicMapper.selectLatestTopics();
    }
}
